class Animal:

    def speak(self):
        raise NotImplementedError("Subclass must implement the speak() method")

class Dog(Animal):
    '''
      子类应重写speak方法
    '''
    def speak(self):
        print('哮天犬在此 Woof !.....')

    def wag_tail(self):
        print('哮天犬的狗尾巴在摇摆')

class Cat(Animal):

    def speak(self):
        print('Tom ')

if __name__ == '__main__':
    dog1=Dog()
    dog1.speak()
    dog1.wag_tail()
    cat1=Cat()
    cat1.speak()